﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace dev.queensland.web.Controllers
{
    public class TenantAccessController : Controller
    {
        // GET: TenantAccess
        public ActionResult Index()
        {
            return View();
        }

        // GET: TenantAccess/Details/5
        public ActionResult Details(int id)
        {
            return View();
        }

        // GET: TenantAccess/Workflow/5
        public ActionResult Workflow(string id)
        {
            return View();
        }

        // GET: TenantAccess/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: TenantAccess/Create
        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        // GET: TenantAccess/Edit/5
        public ActionResult Edit(string id)
        {
            return View();
        }

        // POST: TenantAccess/Edit/5
        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        // GET: TenantAccess/Delete/5
        public ActionResult Delete(int id)
        {
            return View();
        }

        // POST: TenantAccess/Delete/5
        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }


        // GET: TenantAccess/TestApi/5
        public ActionResult TestApi(string id)
        {
            AnacleWebServices.WebService webservice = new AnacleWebServices.WebService();
            webservice.Url = "http://apps.anacle.com/abell.71-KDC_WebSerivce/WebService.asmx";

            AnacleWebServices.AuthHeader header = new AnacleWebServices.AuthHeader();

            header.Username = "webservicekdc";
            header.Password = "webservicekdc";
            webservice.AuthHeaderValue = header;
            string s = webservice.HelloWorld();

            AnacleWebServices.OSpaceBookingDetailsMapping booking = new AnacleWebServices.OSpaceBookingDetailsMapping();
            booking.ObjectIDStr = "ObjectIDStr";

            //AnacleWebServices.SpaceBookingDetailsResult result = webservice.CreateBooking(booking);

            return View();
        }
    }
}
